﻿// JScript 文件
function pageload() {
    // hash doesn't contain the first # character.
   var step = "1"; //第几页
   var PageSize="20" ; //每页显示几个商品  
   var OrderID="";//要查找的订单编号
   var O_order=document.getElementById("OrderID").value;
   if(O_order!="订单编号"&&O_order.length>0)
   {
       OrderID= O_order;
   }
   //why 09-06-30
   var statetypecode="";//意见类型
   var o_StateTypeCode=document.getElementById("ctl00_ContentPlaceHolder1_DDL_Idea");
   if (o_StateTypeCode.selectedIndex>0)
   {
        statetypecode=o_StateTypeCode.options[o_StateTypeCode.selectedIndex].value;
   }
   var Receiver="";//收货人
   var o_receiver=document.getElementById("Receiver").value;
   if(o_receiver!="收货人姓名"&&o_receiver.length>0)
   {
        Receiver=o_receiver;
   }
   var TranCode="";//物流单号
   var o_trancode=  document.getElementById("trancode").value;
   if(o_trancode!="物流单号"&&o_trancode.length>0)
   {
       TranCode= o_trancode;
   }
   var DateFrom=""//起始时间
   var o_datefrom=document.getElementById("DateFrom").value;
   if(o_datefrom!="起始时间"&&o_datefrom.length>0)
   {
        DateFrom=o_datefrom;
   }
   var DateEnd="";//终止时间
   var o_dateend=document.getElementById("DateEnd").value;
   if(o_dateend!="终止时间"&&o_dateend.length>0)
   {
        DateEnd=o_dateend;
   }
   var OrderState="";
//   var O_orderstate=document.getElementById("ctl00_ContentPlaceHolder1_DDP_OrderState");
//   if(O_orderstate.selectedIndex>0)
//   {
//       OrderState= O_orderstate.options[O_orderstate.selectedIndex].value;
//   }
   var Page="1";
   var O_page=document.getElementById("Hid_Page");
   if(O_page!=null)
   {
      Page=O_page.value;
   }     
    $j.post("../Handler/OrderListHandler.ashx", { OrderID: OrderID,statetypecode:statetypecode,Receiver:Receiver,TranCode:TranCode,OrderState:OrderState,PageSize:PageSize,Page:Page,DateFrom:DateFrom,DateEnd:DateEnd},
        function(data){ 
            document.getElementById("OrderList").innerHTML= data;
        }
    );   
  }
function showList()
{
    document.getElementById("OrderList").innerHTML = "<br /><br />数据加载中......<br /><br /><img src='../images/ajax-loader.gif'>";	
    initPage();
}
function initPage()
 {
    // Initialize history plugin.
    // The callback is called at once by present location.hash. 
    $j.historyInit(pageload);    
    
}
function GetFocus(obj,str)
{    
    
    if(obj.value==str)
    {
        obj.value="";
    }
}
function LoseFocus(obj,str)
{    
    if(obj.value.length<1)
    {
        obj.value=str;
    }
}
//---翻页
function ChangePage(page)
{
    if(document.getElementById("tmpImg")!=null)
    {
        document.getElementById("tmpImg").style.display="block";
    }
    else
    {
        document.getElementById("OrderList").innerHTML = "<br /><br />数据加载中......<br /><br /><img src='../images/ajax-loader.gif'>";	
    }
    document.getElementById("Hid_Page").value=page;
    pageload();
}
//查找
function Search()
{
    if(document.getElementById("tmpImg")!=null)
    {
        document.getElementById("tmpImg").style.display="block";
    }
    else
    {
        document.getElementById("OrderList").innerHTML = "<br /><br />数据加载中......<br /><br /><img src='../images/ajax-loader.gif'>";	
    }
    pageload();
}
function loadTime(obj1,obj2,str)
{
     if(obj1.value==str)
        {
            obj1.value="";
            getDateString(obj1,obj2);
        }
        else
        {
            getDateString(obj1,obj2);
        }
}
